all: main32 main16 main4 
noopt: main32_d main16 main4 

main32: main32.o scaffold32.o
	gcc -o main32 main32.o scaffold32.o -lgmp -O4 -fomit-frame-pointer  -pipe -march=i686

main32.o: main32.c
	gcc -c  main32.c -O4 -fomit-frame-pointer  -pipe -march=i686

scaffold32.o: scaffold32.c 
	gcc -c  scaffold32.c  -O4 -fomit-frame-pointer -pipe -march=i686
	
main32_d: main32.o_d scaffold32.o_d
	gcc -o main32 main32.o scaffold32.o  -lgmp 

main32.o_d: main32.c
	gcc -c  main32.c 

scaffold32.o_d: scaffold32.c 
	gcc -c  scaffold32.c 

main16: main16.o scaffold16.o
	gcc -o main16 main16.o scaffold16.o multiply.o -lgmp  
	
main16.o: main16.c
	gcc -c main16.c 

scaffold16.o: scaffold16.c
	gcc -c  multiply.c 
	gcc -c  scaffold16.c 
	
main4: main4.o scaffold4.o
	gcc  -o main4 main4.o scaffold4.o -lgmp

main4.o: main4.c
	gcc -c main4.c

scaffold4.o: scaffold4.c
	gcc -c scaffold4.c

clean: 
	rm *.o

tar.gz: 
	tar czvf project_b503_thilina_`date '+%d-%m-%Y'`.tar.gz *.c Makefile Readme
	
